<!--
  ~
  ~   ~ MIT License
  ~   ~
  ~   ~ Copyright (c) 2021-2022 yangrunkang
  ~   ~
  ~   ~ Author: yangrunkang
  ~   ~ Email: yangrunkang53@gmail.com
  ~   ~
  ~   ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~   ~ of this software and associated documentation files (the "Software"), to deal
  ~   ~ in the Software without restriction, including without limitation the rights
  ~   ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~   ~ copies of the Software, and to permit persons to whom the Software is
  ~   ~ furnished to do so, subject to the following conditions:
  ~   ~
  ~   ~ The above copyright notice and this permission notice shall be included in all
  ~   ~ copies or substantial portions of the Software.
  ~   ~
  ~   ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~   ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~   ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~   ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~   ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~   ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~   ~ SOFTWARE.
  ~
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/user/manage/apply.css}"/>
<!--脚本-->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/user/manage/apply.js}"></script>
<div th:fragment="content">
    <div class="container">
        <div class="row g-2">
            <!--提示-->
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2 mb-2">
                    <div class="lead border-bottom mb-2">申请管理</div>
                    <div>
                        <div class="table-responsive fixed-table-body">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <td class="fw-bold" style="width: 8%;">序号</td>
                                    <td class="fw-bold" style="width: 26%;">申请内容</td>
                                    <td class="fw-bold" style="width: 10%;">申请类型</td>
                                    <td class="fw-bold" style="width: 6%;">状态</td>
                                    <td class="fw-bold" style="width: 6%;">进度</td>
                                    <td class="fw-bold hidden-xs" style="width: 20%;">创建时间</td>
                                    <td class="fw-bold" style="width: 24%;">操作</td>
                                    </tr>
                            	</thead>
                            	<tbody>
                                    <tr th:if="!${#lists.isEmpty(memberIndexDto.listApplyDto.applyEnhanceList)}"
                                    th:each="applyEnhance,ite : ${memberIndexDto.listApplyDto.applyEnhanceList}"
                                >
                                    <td th:text="${ite.count}"></td>
                                    <td>
                                        <p th:utext="${applyEnhance.apply.applyContent}"></p>
                                    </td>
                                    <td>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${applyEnhance.apply.applySource.name()} == 'CONSULTING_SERVICE'">咨询服务</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${applyEnhance.apply.applySource.name()} == 'NEW_FEATURES'">新功能建议</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${applyEnhance.apply.applySource.name()} == 'AD'">广告</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${applyEnhance.apply.applySource.name()} == 'TAG'">标签</span>
                                    </td>
                                    <!--状态-->
                                    <td>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-success" th:if="${applyEnhance.apply.applyStatus.name()} == 'WAIT_APPLY' or ${applyEnhance.apply.applyStatus.name()} == 'APPLYING' or ${applyEnhance.apply.applyStatus.name()} == 'APPLY_PASS' or ${applyEnhance.apply.applyStatus.name()} == 'APPLY_DOCUMENT_COMMIT'">正常</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-danger" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_REFUSE'">拒绝</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-danger" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_TERMINATE'">结束</span>
                                    </td>
                                    <!--进度-->
                                    <td>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-primary" th:if="${applyEnhance.apply.applyStatus.name()} == 'WAIT_APPLY'">待审核</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLYING'">审核中</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-success" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_PASS'">已通过</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-danger" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_REFUSE'">已拒绝</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-danger" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_TERMINATE'">已终止</span>
                                        <span class="badge bg-gradient rounded-3 fw-normal bg-primary" th:if="${applyEnhance.apply.applyStatus.name()} == 'APPLY_DOCUMENT_COMMIT'">材料已提交</span>
                                    </td>
                                    <td class="hidden-xs" th:text="${applyEnhance.createDate}">创建时间</td>
                                    <td style=";">
                                        <div class="btn-group rounded-3 bg-gradient" role="group" aria-label="Second group">
                                            <button type="button" class="btn rounded-3 bg-gradient btn-outline-dark btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                操作
                                            </button>
                                            <div class="dropdown-menu dropdown-menu-right border-0 shadow-lg">
                                                <a class="cv-link dropdown-item small" th:onclick="applyOperate('stop',[[${applyEnhance.apply.applyId}]],[[${applyEnhance.apply.userId}]])"><span th:include="fragments/icon::zhongzhi"></span>终止</a>
                                                <a class="cv-link dropdown-item small" th:onclick="applyOperate('delete',[[${applyEnhance.apply.applyId}]],[[${applyEnhance.apply.userId}]])"><span th:include="fragments/icon::shanchu"></span>删除</a>
                                            </div>
                                        </div>
                                        <a class="btn rounded-3 bg-gradient btn-outline-dark btn-sm"
                                           th:if="${applyEnhance.apply.applySource.name()} == 'AD' and ${applyEnhance.apply.applyStatus.name()} == 'APPLY_PASS'"
                                           th:href="'/user/manage/apply/commit/'+${applyEnhance.apply.applyId}">提交材料</a>
                                    </td>
                                </tr>
                            	</tbody>
                            </table>
                        </div>
                    </div>
                    <div th:if="${#lists.isEmpty(memberIndexDto.listApplyDto.applyEnhanceList)}" th:include="fragments/index::empty_content"></div>
                    <div th:replace="fragments/page::page(${memberIndexDto.listApplyDto.pageDtoList})"></div>
                    <hr />
                    <strong>说明</strong>
                    <ul>
                        <li>申请类型为<span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark">广告</span>时,需要等待审核通过后,才可以提交相应的材料,例如广告图片等</li>
                        <li>图片等资源或者材料可以委托我们帮您制作及策划,以便提升转化效益</li>
                        <li>如果中间有任何问题,可以通过以下方式进行沟通
                            <ul class="list-unstyled">
                                <li>电话: <code>13955196045</code></li>
                                <li><a class="cv-link" href="mailto:yangrunkang53@gmail.com"><img th:data-src="${ossStatic} + @{/icons/system/email.png}" class="lazyload cv-icon-item"/> 邮箱: <code>yangrunkang53@gmail.com</code></a></li>
                            </ul>
                        </li>
                        <hr />
                        <div>
                            <a class="cv-link" href="/apply-ad" title="广告合作"> 广告合作</a> |
                            <a class="cv-link" href="/apply-tag" title="标签申请"> 标签申请</a> |
                            <a class="cv-link" href="/apply-consultant" title="咨询服务申请"> 咨询服务申请</a>
                        </div>
                    </ul>
                </div>
            </div>
            <!--左列-用户信息-->
            <div class="col-lg-3">
                <div th:include="fragments/index::user_index_left"></div>
            </div>
        </div>
    </div>
</div>
</html>
